Random = Mock.Random

function login(){
    let data = Mock.mock({
        'username' : Random.cname(),
        'avatar' : Random.image()
    })

    let json = {
        data,
        code : 200,
        msg : '登陆成功'
    }

    return json
}

Mock.mock('http://localhost/admin/login.php', 'post', login)